var express = require('express');
var router = express.Router();
var path = require('path')

var fs = require('fs');

/* GET home page. */
router.get('/', function (req, res, next) {
  res.redirect('/add.html')
});


router.get('/login', (request, response) => {
  var dirname = path.resolve(__dirname, '..')
  // console.log(dirname + '/views/index.html');
  response.sendFile(dirname + '/views/index.html')
  // response.sendFile(__dirname + '/index.html')


})

router.post('/myadd', (req, res) => {
 
 
  res.json({
    code: 0,
    msg: '员工添加成功',
    data: req.body
  })


})




module.exports = router;
